package com.aye.notepad.DatabaseModel;

import org.litepal.crud.DataSupport;

import java.util.ArrayList;
import java.util.List;

public class User extends DataSupport {
    private int id;
    private String name;
    private String password;
    private String phone;
    private String birthday;
    private String sex;

    private List<Record> recordList=new ArrayList<Record>();
    public List<Record> getRecordLists(){
        List<Record> recordList = new ArrayList<Record>();
                recordList=DataSupport.where("user_id=?", String.valueOf(id)).find(Record.class);
        return recordList;
    }
    public List<Record> getRecordList() {
        return recordList;
    }

    public void setRecordList(List<Record> recordList) {
        this.recordList = recordList;
    }

    public User() {
    }

    public User(String name, String password, String phone, String birthday, String sex) {
        this.name = name;
        this.password = password;
        this.phone = phone;
        this.birthday = birthday;
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", birthday='" + birthday + '\'' +
                ", sex='" + sex + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
